#!/bin/bash


test=mtu9000

dir="${test}/p/*"

echo "dir $dir"

echo "" >${test}/extractp$1.txt

for iperflog in ${dir[*]}
do
    #if [ -d "$iperflog" ]; then
        more $iperflog | grep "receiver" | awk '{print $7}' >> ${test}/extractp$1.txt

    #fi
done

sum=`awk '{sum += $1};END {print sum}' ${test}/extractp$1.txt`
echo "sum is ${sum}"
